Algorithm 1. Local Search pseudocode with k=1.

Considering a given candidate solution s:

begin local search s_local = s for i = 1 to I ≤ |A| do s' ← switch the i-th bit of string s

   if f(s') > f(s) then s_local ←s'

   end if end for returns_local end local search